package com.ipDev.moyvSys;

import com.ipDev.moyvSys.domain.dto.ProblemDTO;
import com.ipDev.moyvSys.domain.po.Problem;
import com.ipDev.moyvSys.service.IProblemService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
@Slf4j
public class test4Problem {
    @Autowired
    private IProblemService problemService;

    @Test
    public void test1() {
        ProblemDTO dto = new ProblemDTO();
        dto.setProblemId(10);
        dto.setPoint(114);
        dto.setAnswer("TEST_PASS");
        Problem problem = new Problem();
        problem.setId(dto.getProblemId());
        BeanUtils.copyProperties(dto, problem);
        problemService.updateById(problem);
    }
}
